
#ifndef __DATATYPE_DEF__H__
#define __DATATYPE_DEF__H__


typedef unsigned char	u08t;
typedef char			s08t;

typedef unsigned short	u16t;
typedef short			s16t;

typedef unsigned int	u32t;
typedef int				s32t;


typedef void(*HDLR_PTR)(void);

typedef int(*FUNC_PTR)(void*, int, int);

#ifndef NULL
#define NULL	(void*)0
#endif
#ifndef TRUE
#define TRUE	1
#endif
#ifndef FALSE
#define FALSE	0
#endif


#define ABS(x) ((x) > 0 ? (x) : -(x))

#define U08TOU16(c1, c2)	(u16t)((c1) | ((c2)<<8))
#define U08TOS16(c1, c2)	(s16t)((c1) | ((c2)<<8))
#define U08TOU32(c1, c2, c3, c4)	(u32t)((c1) | ((c2)<<8) | ((c3)<<16) | ((c4)<<24))
#define U08TOS32(c1, c2, c3, c4)	(s32t)((c1) | ((c2)<<8) | ((c3)<<16) | ((c4)<<24))


#define MSG_EXTERN_EVENT	0x80
#define MSG_TIMER_EVENT		0x01
#define MSG_KEYPAD_EVENT	0x02
#define MSG_NVRAM_EVENT		0x03


#define MSG_EXTERN_COM_EVENT	0x81
#define MSG_EXTERN_CAN_EVENT	0x82


typedef struct {
	u08t MainCmd;
	u08t SubCmd;
	u08t NodeID;
	u08t Status;
	u32t Param;
	u08t MasterID;
	u08t ForceRespond;
} CMD_DATA_T;

typedef struct {
	u08t DataCont[14];
	u08t MsgType;
	u08t DataLen;
} DATA_CELL_T;

#include "custom_def.h"

#endif /*__DATATYPE_DEF__H__*/
